// author by welong
// zuowl@qq.com
// 2014-09-06  10:31
// PAT basic 1012

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
	int i, j, sign = 1, c_3 = 0;
	int count, input, output[5] = {0}, mark[5] = {0};

	scanf("%d", &count);	//4 1 1 1 1, printf 0, not N.cause test site 8 error
	for(i = 0; i < count; i++)
	{
		scanf("%d", &input);
		
		j = input % 5;

		if(j != 0)
			mark[j] = 1;

		switch(j)
		{
		case 0:
			if(input %2 == 0)
			{
				mark[j] = 1;
				output[j] += input;
			}
			break;
		case 1:
			if(sign)
			{
				output[j] += input;
				sign = 0;
			}
			else
			{
				output[j] -= input;
				sign = 1;
			}
			break;
		case 2:
			output[j]++;
			break;
		case 3:
			output[j] += input;
			c_3++;
			break;
		case 4:
			if(input > output[j])
				output[j] = input;
			break;
		default:
			return 0;
		}
	}
	
	for(i = 0; i < 3; i++)
	{
		if(mark[i] == 0)
			printf("N ");
		else
			printf("%d ", output[i]);
	}

	if(mark[3] == 0)
		printf("N ");
	else
		printf("%.1f ", (float)output[3]/c_3);

	if(mark[4] == 0)
		printf("N\n");
	else
		printf("%d\n", output[4]);

	return 0;
}